
***************************************************
**   the do file regression tables IV Model
**    
**         
**      
***************************************************


clear all
set more off

log using 02_analysis.log
use 02_panel.dta

**+++++++++Table 2(continued)===================
sum rain_3


**+++++++++Table 6===================

tsset id timeid
char   type[omit] 1 
xi:xtreg dailyrepost rain_3 i.type i.position_code i.rank_code

ttest rain_3=0
predict dailyhat
gen ln=ln(dailyhat)

xtreg discipline ln i.type i.position_code i.rank_code
set matsize 2000
probit chuli ln i.type i.position_code i.rank_code i.timeid

**==============Interaction=====================
gen dummy=0
replace dummy=1 if rain_2>50   //>12 hours 小雨
gen interaction=ln(dailyhat)*dummy


char   type[omit] 1 
xtreg discipline ln i.type i.position_code i.rank_code interaction

set matsize 2000
probit chuli ln i.type i.position_code i.rank_code interaction i.timeid

log close














